﻿function ToSearch(name) {
    var key = escape(document.getElementById('search1').value);
    if (key == "请输入标题关键字" || key == "请输入股票代码") {
        key = "";
    }
    var date1 = document.getElementById('date1').value;
    var date2 = document.getElementById('date2').value;
    var dt1 = new Date(date1);
    var dt2 = new Date(date2);
    if (dt1 > dt2) {
        alert("开始时间不能大于结束时间！");
    }
    else {
        if (key.length < 6) {
            alert("请输入完整股票代码。");
        }
        else {
            window.location.href = '../../eGoldSearch.aspx?col=' + name + '&key=' + key + '&date1=' + document.getElementById('date1').value + '&date2=' + document.getElementById('date2').value;
        }
    }
}
function ToSearchText(name) {
    var key = escape(document.getElementById('search').value);
    if (key == "请输入标题关键字" || key == "请输入股票代码") {
        key = "";
    }
    var date1 = document.getElementById('date1').value;
    var date2 = document.getElementById('date2').value;

    var dt1 = new Date(date1);
    var dt2 = new Date(date2);
    if (dt1 > dt2) {
        alert("开始时间不能大于结束时间！");
    }
    else {
        if (key.length < 6) {
            alert("请输入完整股票代码。");
        }
        else {
            window.location.href = '../../eGoldSearch.aspx?col=' + name + '&key=' + key + '&date1=' + document.getElementById('date1').value + '&date2=' + document.getElementById('date2').value;
        }
    }
}